package com.tinxing.bp.commons.utils.exception;

/**
 * @author YJH
 * @date 2019/12/20 19:37
 */
public class GunsException extends RuntimeException {

    /**
     *
     */
    private static final long serialVersionUID = -8490759249013729324L;

    private Integer code;

    private String message;

    public GunsException(ServiceExceptionEnum serviceExceptionEnum) {
        this.code = serviceExceptionEnum.getCode();
        this.message = serviceExceptionEnum.getMessage();
    }

    public GunsException(String message) {
        this.code = 500;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
